<?php
require 'Admin/Common/ViewModel.php';
class Controller{
	protected $mod;
	protected $view;
	protected $model;
	function __Construct(){
		$c =isset($_GET['c'])?$_GET['c']:'index' ;
		$m = isset($_GET['m'])?$_GET['m']:'index' ;
		$this->view = new ViewModel($c.'/'.$m);
        session_start();
        if(!isset($_SESSION['admin'])){
            echo '<h2 style="font-family:微软雅黑;color: #03c2f9">您没有登录，请登陆后再访问!<br/></h2>';
            echo '<a href="index.php">如果没有跳转，请点这里跳转</a>';
            header("refresh:3;url='index.php'");
        }
	}
	function display() {
		$this->view->display();
	}
	function assign($variable, $value) {
		$this->view->assign($variable, $value);
	}
}
?>